/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is Forte for Java, Community Edition. The Initial
* Developer of the Original Code is Sun Microsystems, Inc. Portions
* Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.modules.debugger.support;
import org.openide.util.NbBundle;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.util.ResourceBundle;
import javax.swing.JCheckBox;
import javax.swing.JRadioButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.ButtonGroup;
/**
* Panel for ActionTI selector.
*
* @author Jan Jancura
*/
public class ActionTIPanel extends javax.swing.JPanel {
static final long serialVersionUID =-6616273620175196604L;
private JRadioButton[] cbComments;
private JCheckBox cbShowDialog;
private DebuggerSettings debuggerSettings;
/** Creates new form ActionTIPanel */
public ActionTIPanel () {
initComponents ();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents () {
debuggerSettings = (DebuggerSettings) DebuggerSettings.
findObject (DebuggerSettings.class);
String[] comments = debuggerSettings.getActionTIComments ();
int[] constants = debuggerSettings.getActionTIConstants ();
int i, k = comments.length;
cbComments = new JRadioButton [k];
ResourceBundle bundle = NbBundle.getBundle (ActionTIPanel.class);
setLayout (new BorderLayout ());
JLabel l = new JLabel (
bundle.getString ("CTL_ActionOnTraceInto")
);
add (l, "North"); // NOI18N
JPanel p = new JPanel (new GridLayout (k + 1, 1));
ButtonGroup bg = new ButtonGroup ();
for (i = 0; i < k; i++) {
cbComments [i] = new JRadioButton (comments [i]);
cbComments [i].setSelected (
debuggerSettings.getActionOnTraceInto () == constants [i]
);
bg.add (cbComments [i]);
p.add (cbComments [i]);
}
// p.add (new JPanel ());
cbShowDialog = new JCheckBox (
bundle.getString ("CTL_Do_not_show_this_dialog")
);
cbShowDialog.setSelected (debuggerSettings.isActionOnTraceIntoSet ());
p.add (cbShowDialog);
add (p, "Center"); // NOI18N
}
public void updateSettings () {
debuggerSettings.setActionOnTraceIntoSet (cbShowDialog.isSelected ());
int[] constants = debuggerSettings.getActionTIConstants ();
int i, k = constants.length;
for (i = 0; i < k; i++)
if (cbComments [i].isSelected ()) {
debuggerSettings.setActionOnTraceInto (constants [i]);
return;
}
}
}
/*
* Log
* 2 Gandalf 1.1 1/18/00 Jan Jancura More buttons...
* 1 Gandalf 1.0 1/18/00 Jan Jancura
* $
*/